package me.zhengjie.domain;


import lombok.RequiredArgsConstructor;
import me.zhengjie.dto.sqlServer.Pallet;
import me.zhengjie.repository.PalletRepository;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
public class PalletService {

    private final PalletRepository palletRepository;

    public Pallet findLastUpdatePalletByStationCode(String stationCode) {
        return palletRepository.findPalletOrOrderByUpdateTimeAndStationCode(stationCode).get(0);
    }

    public Pallet findByPalletCode(String palletCode) {
        return palletRepository.findPalletByPalletCode(palletCode);
    }
}
